
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="Python">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>cutout module &#8212; deepaugment 0.2.0 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="module-cutout">
<span id="cutout-module"></span><h1>cutout module<a class="headerlink" href="#module-cutout" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="cutout.create_cutout_mask">
<code class="descclassname">cutout.</code><code class="descname">create_cutout_mask</code><span class="sig-paren">(</span><em>img_height</em>, <em>img_width</em>, <em>num_channels</em>, <em>size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cutout.html#create_cutout_mask"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cutout.create_cutout_mask" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a zero mask used for cutout of shape <cite>img_height</cite> x <cite>img_width</cite>.
Args:</p>
<blockquote>
<div>img_height: Height of image cutout mask will be applied to.
img_width: Width of image cutout mask will be applied to.
num_channels: Number of channels in the image.
size: Size of the zeros mask.</div></blockquote>
<dl class="docutils">
<dt>Returns:</dt>
<dd>A mask of shape <cite>img_height</cite> x <cite>img_width</cite> with all ones except for a
square of zeros of shape <cite>size</cite> x <cite>size</cite>. This mask is meant to be
elementwise multiplied with the original image. Additionally returns
the <cite>upper_coord</cite> and <cite>lower_coord</cite> which specify where the cutout mask
will be applied.</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="cutout.cutout_numpy">
<code class="descclassname">cutout.</code><code class="descname">cutout_numpy</code><span class="sig-paren">(</span><em>img</em>, <em>size=16</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/cutout.html#cutout_numpy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#cutout.cutout_numpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Apply cutout with mask of shape <cite>size</cite> x <cite>size</cite> to <cite>img</cite>.
The cutout operation is from the paper <a class="reference external" href="https://arxiv.org/abs/1708.04552">https://arxiv.org/abs/1708.04552</a>.
This operation applies a <cite>size`x`size</cite> mask of zeros to a random location
within <cite>img</cite>.
Args:</p>
<blockquote>
<div>img: Numpy image that cutout will be applied to.
size: Height/width of the cutout mask that will be</div></blockquote>
<dl class="docutils">
<dt>Returns:</dt>
<dd>A numpy tensor that is the result of applying the cutout mask to <cite>img</cite>.</dd>
</dl>
</dd></dl>

</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">deepaugment</a></h1>








<h3>Navigation</h3>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2019, Baris Ozmen.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.3</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/lib.cutout.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>